package com.db.server.demo;

import java.util.Arrays;

import com.db.server.Server;

public class DemoServer {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		int port = 40000;
		int index = Arrays.binarySearch(args, "-port"); 
		if (index >= 0 && index < args.length - 1) {
			try {
				port = Integer.valueOf(args[index + 1]);
			} catch (NumberFormatException exception) {
				port = 40000;
			}
		}
		Server server = new Server(port);
		server.addTicketSymbol("AAPL");
		server.addTicketSymbol("GOOG");
		server.addTicketSymbol("DELL");
		server.addTicketSymbol("MSFT");
		server.addTicketSymbol("AMZN");
		server.addTicketSymbol("FB");
		server.addTicketSymbol("YNDX");
		server.addTicketSymbol("DB");
		server.addTicketSymbol("EBAY");
		server.addTicketSymbol("ORCL");
		server.start();
		System.out.println("start server");
	}

}
